package a.f.h.d;

class w
{
  private p[] a;
  private int c;
  
  public w(int paramInt)
  {
    this.a = new p[paramInt + 2];
    this.c = 0;
  }
  
  public void a(int paramInt, p paramp)
  {
    this.c += 1;
    paramp.a = paramInt;
    paramp.d = this.c;
    c(this.c, paramp);
  }
  
  public void a()
  {
    int j = j.r;
    boolean bool = j.q;
    int i = 1;
    if (i <= this.c) {}
    while (j != 0)
    {
      this.a[i] = null;
      i++;
      if ((j == 0) && (bool)) {
        return;
      }
      if (!bool) {
        break;
      }
    }
    this.c = 0;
  }
  
  public void c(int paramInt, p paramp)
  {
    int j = j.r;
    boolean bool = j.q;
    this.a[0] = paramp;
    int i = paramInt / 2;
    p localp = this.a[i];
    if (localp.a > paramp.a) {
      this.a[paramInt] = localp;
    }
    do
    {
      localp.d = paramInt;
      paramInt = i;
      i >>= 1;
      localp = this.a[i];
      if ((j == 0) && (bool)) {
        return;
      }
      if (!bool) {
        break;
      }
      this.a[paramInt] = paramp;
    } while (j != 0);
    paramp.d = paramInt;
  }
  
  public void e(int paramInt, p paramp)
  {
    int j = j.r;
    boolean bool = j.q;
    int i = paramInt << 1;
    this.a[(this.c + 1)] = this.a[this.c];
    if (i <= this.c) {}
    label117:
    do
    {
      p localp = this.a[i];
      if ((j == 0) && (bool)) {
        return;
      }
      if (j == 0) {
        if (i < this.c)
        {
          if (j != 0) {
            break label117;
          }
          if (this.a[(i + 1)].a < localp.a) {
            localp = this.a[(++i)];
          }
        }
      }
      if (j == 0)
      {
        if (paramp.a > localp.a)
        {
          this.a[paramInt] = localp;
          localp.d = paramInt;
          paramInt = i;
        }
      }
      else
      {
        i <<= 1;
        if (!bool) {
          break;
        }
      }
      this.a[paramInt] = paramp;
    } while (j != 0);
    paramp.d = paramInt;
  }
  
  public void a(p paramp)
  {
    int i = j.r;
    p localp = this.a[this.c];
    this.a[this.c] = null;
    this.c -= 1;
    if ((i != 0) || (paramp != localp))
    {
      if (i == 0)
      {
        if (localp.a > paramp.a)
        {
          if (i != 0) {
            break label83;
          }
          e(paramp.d, localp);
        }
      }
      else if (!j.q) {
        return;
      }
      label83:
      c(paramp.d, localp);
    }
  }
  
  public void a(p paramp, int paramInt)
  {
    paramp.a = paramInt;
    c(paramp.d, paramp);
  }
  
  public p b()
  {
    return this.a[1];
  }
  
  public boolean c()
  {
    if (j.r == 0) {}
    return this.c == 0;
  }
  
  public int e()
  {
    return this.c;
  }
}


/* Location:           E:\idea\
 * Qualified Name:     a.f.h.d.w
 * JD-Core Version:    0.7.0.1
 */